package com.cloud.wms.injection.modules;

import android.app.Activity;
import android.content.Context;

import androidx.fragment.app.Fragment;

import com.cloud.wms.injection.scopes.PerFragment;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Tanghaibo
 * 2018/3/23
 * description:
 */

@Module
public class FragmentModule {
    private Fragment fragment;

    public FragmentModule(Fragment fragment){
        this.fragment = fragment;
    }

    @PerFragment
    @Provides
    public Context provideContext(){
        return fragment.getContext();
    }

    @Provides
    @PerFragment
    public Activity provideActivity(){
        return fragment.getActivity();
    }

}

